package game;

/**
 * <p>A <tt>GameStateListener</tt> wants to be notified whenever an important change occurs in a <tt>GameState</tt></p>
 * 
 * @author Mark Kelly
 * @date February 20, 2010
 * @version 2.0
 *
 * @author Mark Kelly
 * @date March 6, 2010
 * @version 3.0
 */
public interface GameStateListener {
	/**
	 * Called when a <tt>Piece</tt> has been moved
	 * 
	 * @param p the <tt>Piece</tt> that moved
	 * @param b the <tt>ChessBoard</tt> which owns the <tt>Piece</tt> that was moved
	 */
	void pieceMoved(Piece p, ChessBoard b);
	
	/**
	 * <p>Takes appropriate actions after being notified that a game has started.</p>
	 * <p>In comparison with <tt>initialUpdate()</tt>, this method should be called when a game is initialized.</p>
	 * 
	 * @param gs the <tt>GaneState</tt> representing the game that has started.
	 */
	void gameStarted(GameState gs);
	
	/**
	 * <p>Takes appropriate actions when the <tt>GameState</tt> has changed.</p>
	 * <p>This method should be called only in more general cases than <tt>pieceMoved()</tt> and <tt>gameStarted</tt>.</p>
	 * 
	 * @param gs the <tt>GameState</tt>
	 */
	void stateChanged(GameState gs);
}
